-- @name 多地图循环任务
-- @version 1.0.0
-- @description 自动遍历多个地图并执行停留操作
-- @require modules/map.lua
-- @require modules/movement.lua

local logger = require("utils.logger")
local ConfigLoader = require("config.loader")
local Settings = require("config.settings")
local config = ConfigLoader.load(Settings.CURRENT_GAME)
local map = require("modules.map")
local movement = require("modules.movement")
local combat = require("modules.combat")
local window = require("modules.window")

local task = {
    monitor_time = 10 * 60 * 1000 -- 监测是否还在当前地图
}

function task.run(map_name)
    logger.info("启动单地图循环任务:" .. map_name)
    while true do
        local success = map.enterMapAndFight(map_name)
        if not success then
            logger.error(string.format("%s进入失败超过最大重试次数", map_name))
             mSleep(task.monitor_time)
        end
    end
end

return task
